﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using Pampa.WebControls;

namespace Pampa.MVC.Fluent.CustomControls
{
    public class CollapsablePanelBeginBuilder : IHtmlString 
    {
        private readonly CollapsablePanel _collapsablePanel;

        public CollapsablePanelBeginBuilder(CollapsablePanel collapsablePanel)
        {
            _collapsablePanel = collapsablePanel;
            _collapsablePanel.CssClass = "collapsablePanel";
        }

        public CollapsablePanelBeginBuilder ClientId(string clientId)
        {
            _collapsablePanel.ID = clientId;
            return this;
        }

        public CollapsablePanelBeginBuilder Title(string title)
        {
            _collapsablePanel.Title = title;
            return this;
        }

        public CollapsablePanelBeginBuilder Width(int width)
        {
            _collapsablePanel.Width = width;
            return this;
        }

        public string ToHtmlString()
        {
            var sb = new StringBuilder();
            sb.Append(_collapsablePanel.RenderBeginTag());

            return sb.ToString();
        }
    }
}
